1. Field of the Invention
The present invention relates to an imaging device which images a moving object using an imaging element such as a CCD, and restores a still image of the object from a motion-blurred image of the object, and more particularly relates to a bar code scanner which reads bar codes.
2. Description of the Related Art
For example, laser scanners are known as bar code scanners. A laser scanner reads a bar code by scanning the bar code in one direction (e.g., by moving the bar code in one direction with respect to a fixed bar code scanner), and detecting the widths of the black and white bars in the bar code according to the intensity of the reflected light.
However, in cases where a bar code is moved in one direction relative to a bar code scanner as described above, a one-dimensional bar code can be read, but a two-dimensional bar code that has information in the form of a planar surface cannot be read.
A conceivable method of reading a two-dimensional bar code is a method in which the two-dimensional bar code is imaged using (for example) an imaging device which has imaging elements that are lined up in rows in two dimensions. However, in cases where a bar code is imaged by an imaging device, it is necessary to image the bar code in a stationary or close-to-stationary state. The reason for this is that since the individual imaging elements contained in the imaging device detect the quantity of light that is input during the shutter-opening time (exposure time), an amount of motion blurring that is equal to
movement speed/shutter-opening time
is generated if the bar code is moving, so that a clear image cannot be obtained. Specifically, if a clear image cannot be obtained, the outlines of the black and white bars of the bar code become indistinct, so that the widths of the black and white bars of the bar code cannot be detected. As a result, the bar code cannot be read. In order to suppress such motion blurring, it is necessary to make the shutter-opening time infinitely short, and to convert the external environment into an environment which has a quantity of light that matches the shutter-opening time. However, this is impractical.
Accordingly, an object of the present invention is to provide an imaging device which can image a moving bar code, and which read the bar code from this image.
A further object of the present invention is to provide an imaging device which can image a moving object and restore a still image of the object from a motion-blurred image of the object.
For achieving the above object, an imaging device of the present invention restores a still image of a moving object from portions including the object in an image by using a movement distance of the object during an exposure time and the difference value between output values of adjacent pixels, the movement distance being calculated as a number of pixels.
Preferably, an imaging device of the present invention, for imaging an object with a specified exposure time at specified time intervals using a plurality of imaging elements arranged in two dimensions, comprises:
a calculation unit for calculating, as the number of imaging elements, the movement distance traveled by the object during the exposure time within an image corresponding to the output values of the plurality of imaging elements; and
a restoration unit for restoring a still image of the object from portions including the object within said image by using the movement distance and the difference values between the output values of adjacent imaging elements.
More specifically, the imaging device of the present invention further comprises:
a first memory for storing a first image; and
a second memory for storing a second image that is imaged following the first image;
wherein said calculation unit calculates the movement distance of the object during said time interval on the basis of the difference between the position of the portions including the object within the first image and the position of the portions including the object within the second image, and further calculates the movement distance of the object during said exposure time within the first image or second image on the basis of the ratio of said exposure time to said time interval.